package fr.afcepf.iziticket.beans;

import javax.faces.context.FacesContext;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.jsf.FacesContextUtils;

public class MainManagedBean {

	//private static ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:app-config.xml");
	private static WebApplicationContext context;
	public MainManagedBean() {
	}

	public static ApplicationContext getContext() {
		if(context == null){
			context =  FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
		}
		return context;
	}

}
